package com.study.modules.designPatterns.No4ResponsibilityChainMode;

/**
 * 实现Logger接口的具体类
 */
public class FileLogger implements Logger {

    private Logger next;

    @Override
    public void setNext(Logger next) {
        this.next = next;
    }

    @Override
    public Logger getNext() {
        return next;
    }

    @Override
    public void log(String message) {
        System.out.println("文件日志打印消息: " + message);
        if (next != null) {
            next.log(message);
        }
    }
}
